// cover some element-ui styles
@import './variables.scss';

// Typography adjustments
.el-breadcrumb__inner,
.el-breadcrumb__inner a {
  font-weight: 400 !important;
  color: $textBody;
  font-size: 14px;
}

.el-breadcrumb__item:last-child .el-breadcrumb__inner {
  color: $primaryBlue;
}

// Forms and inputs
.el-input__inner {
  border-radius: $radiusSmall;
  border: 1px solid rgba($primaryBlue, 0.2);
  height: 36px;
  font-size: 14px;
  transition: all 0.2s ease;
  
  &:focus {
    border-color: $primaryBlue;
    box-shadow: 0 0 0 2px rgba($primaryBlue, 0.1);
  }
  
  &:hover:not(:focus) {
    border-color: $primaryBlue;
  }
}

.el-form-item.is-success .el-input__inner {
  border-color: $success;
}

.el-form-item__label {
  font-size: 14px;
  padding-right: 12px;
  color: $darkText;
  line-height: 1.5;
}

.el-form--inline .el-form-item {
  margin-right: 16px;
  display: inline-flex;
  align-items: center;
  
}

.el-upload {
  input[type="file"] {
    display: none !important;
  }
}

.el-upload__input {
  display: none;
}

// Dialog styles with light header
.el-dialog {
  transform: none;
  left: 0;
  position: relative;
  margin: 0 auto;
  border-radius: $radiusLarge;
  overflow: hidden;
  box-shadow: $shadowDialog;
  
  .el-dialog__header {
    background-color: #FFFFFF;
    padding: 16px 20px;
    border-bottom: 1px solid rgba($primaryBlue, 0.1);
    
    .el-dialog__title {
      color: $darkText;
      font-weight: 600;
      font-size: 18px;
      line-height: 1.4;
    }
    
    .el-dialog__headerbtn {
      top: 16px;
      right: 16px;
      
      .el-dialog__close {
        color: $textLight;
        font-size: 18px;
        
        &:hover {
          color: $neonAccent;
        }
      }
    }
  }
  
  .el-dialog__body {
    padding: 24px;
    color: $textBody;
    font-size: 14px;
    line-height: 1.5;
  }
  
  .el-dialog__footer {
    padding: 16px 20px;
    border-top: 1px solid rgba($primaryBlue, 0.1);
    text-align: right;
  }
}

// Button styles
.el-button {
  border-radius: $radiusMedium;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  
  &:hover,
  &:focus {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba($primaryBlue, 0.15);
  }
  
  &:active {
    transform: scale(0.98);
  }
  
  &.is-disabled {
    opacity: 0.6;
    &:hover {
      transform: none;
      box-shadow: none;
    }
  }
  
  &--small {
    padding: 6px 12px;
    font-size: 12px;
  }
}

.el-button--primary {
  background-color: $primaryBlue;
  border-color: $primaryBlue;
  box-shadow: 0 2px 6px rgba($primaryBlue, 0.3);
  
  &:hover, &:focus {
    background-color: lighten($primaryBlue, 5%);
    border-color: lighten($primaryBlue, 5%);
    box-shadow: 0 4px 8px rgba($primaryBlue, 0.4);
  }
  
  &:active {
    background-color: $primaryActive;
    border-color: $primaryActive;
  }
}

// Form buttons should be more compact
.el-form-item__content {
  .el-button {
    padding: 8px 16px;
    font-size: 14px;
    margin-right: 8px;
  }
}

.el-button--success {
  background-color: $success;
  border-color: $success;
  box-shadow: 0 2px 6px rgba($success, 0.3);
  
  &:hover, &:focus {
    background-color: lighten($success, 5%);
    border-color: lighten($success, 5%);
    box-shadow: 0 4px 8px rgba($success, 0.4);
  }
  
  &:active {
    background-color: darken($success, 5%);
    border-color: darken($success, 5%);
  }
}

.el-button--warning {
  background-color: $warning;
  border-color: $warning;
  box-shadow: 0 2px 6px rgba($warning, 0.3);
  
  &:hover, &:focus {
    background-color: lighten($warning, 5%);
    border-color: lighten($warning, 5%);
    box-shadow: 0 4px 8px rgba($warning, 0.4);
  }
  
  &:active {
    background-color: darken($warning, 5%);
    border-color: darken($warning, 5%);
  }
}

.el-button--danger {
  background-color: $danger;
  border-color: $danger;
  box-shadow: 0 2px 6px rgba($danger, 0.3);
  
  &:hover, &:focus {
    background-color: lighten($danger, 5%);
    border-color: lighten($danger, 5%);
    box-shadow: 0 4px 8px rgba($danger, 0.4);
  }
  
  &:active {
    background-color: darken($danger, 5%);
    border-color: darken($danger, 5%);
  }
}

// 卡片样式增强
.el-card {
  border-radius: $radiusLarge;
  border: none;
  box-shadow: $shadowCard;
  margin-bottom: 20px;
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: 0 6px 16px rgba($primaryBlue, 0.15);
  }
  
  .el-card__header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba($primaryBlue, 0.1);
    font-weight: 600;
    color: $darkText;
  }
  
  .el-card__body {
    padding: 20px;
  }
}

// 标签样式
.el-tag {
  border-radius: 4px;
  padding: 0 8px;
  height: 24px;
  line-height: 22px;
  
  &--success {
    background-color: rgba($success, 0.1);
    color: $success;
    border-color: rgba($success, 0.2);
  }
  
  &--warning {
    background-color: rgba($warning, 0.1);
    color: $warning;
    border-color: rgba($warning, 0.2);
  }
  
  &--danger {
    background-color: rgba($danger, 0.1);
    color: $danger;
    border-color: rgba($danger, 0.2);
  }
  
  &--info {
    background-color: rgba($primaryBlue, 0.1);
    color: $primaryBlue;
    border-color: rgba($primaryBlue, 0.2);
  }
}

// 表格样式优化
.el-table {
  border-radius: $radiusMedium;
  overflow: hidden;
  
  th {
    background-color: $bgLight !important;
    color: $darkText;
    font-weight: 600;
    padding: 12px 0;
    border-bottom: 1px solid rgba($primaryBlue, 0.1);
  }
  
  td {
    padding: 10px 0;
    border-bottom: 1px solid rgba($primaryBlue, 0.05);
  }
  
  .el-table__row {
    transition: all 0.2s ease;
    
    &:hover > td {
      background-color: rgba($primaryBlue, 0.05) !important;
    }
  }
  
  &::before {
    display: none;
  }
}

// 分页组件样式
.el-pagination {
  padding: 20px 0;
  
  button {
    background: #ffffff;
    border-radius: 4px;
    
    &:hover {
      color: $primaryBlue;
    }
  }
  
  .btn-prev, .btn-next {
    padding: 0 10px;
    border-radius: 4px;
    border: 1px solid rgba($primaryBlue, 0.1);
    
    &:hover {
      background-color: rgba($primaryBlue, 0.05);
    }
  }
  
  .el-pager li {
    border-radius: 4px;
    border: 1px solid rgba($primaryBlue, 0.1);
    margin: 0 3px;
    
    &.active {
      background-color: $primaryBlue;
      color: #ffffff;
      border-color: $primaryBlue;
      font-weight: 600;
    }
    
    &:hover:not(.active) {
      color: $primaryBlue;
      background-color: rgba($primaryBlue, 0.05);
    }
  }
}

// 下拉菜单
.el-dropdown-menu {
  padding: 5px 0;
  border-radius: 8px;
  border: none;
  box-shadow: $shadowDropdown;
  
  .el-dropdown-menu__item {
    padding: 8px 16px;
    font-size: 14px;
    line-height: 1.5;
    
    &:hover {
      background-color: rgba($primaryBlue, 0.05);
      color: $primaryBlue;
    }
    
    &--divided:before {
      background-color: rgba($primaryBlue, 0.1);
    }
  }
}

// Select下拉框
.el-select-dropdown {
  border-radius: 8px;
  border: none;
  box-shadow: $shadowDropdown;
  
  .el-select-dropdown__item {
    padding: 8px 16px;
    
    &.selected {
      color: $primaryBlue;
      font-weight: 600;
    }
    
    &.hover {
      background-color: rgba($primaryBlue, 0.05);
    }
  }
}

// 日期选择器
.el-date-picker {
  border-radius: 8px;
  box-shadow: $shadowDropdown;
  
  .el-date-picker__header {
    margin: 12px 0;
  }
  
  .el-date-table td.current:not(.disabled), 
  .el-date-table td.today:not(.disabled) {
    color: $primaryBlue;
    font-weight: 600;
  }
  
  .el-date-table td.current:not(.disabled) span {
    background-color: $primaryBlue;
    color: #ffffff;
  }
}

// 加载中状态
.el-loading-mask {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  
  .el-loading-spinner {
    .circular {
      stroke: $primaryBlue;
    }
    
    .el-loading-text {
      color: $primaryBlue;
      margin-top: 8px;
    }
  }
}

